// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   AdminAction.java

package org.fiel.admin.struts.actions;

import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.fiel.login.FielPrincipal;

public class AdminAction extends Action
{

    public AdminAction()
    {
    }

    protected String obtenerRol(HttpServletRequest request)
    {
        FielPrincipal fielPrincipal = (FielPrincipal)request.getSession().getAttribute("userPrincipal");
        String rol = NIVEL_ACCESO_GENERAL;
        if(fielPrincipal != null)
        {
            List ls = fielPrincipal.getRoles();
            for(Iterator iter = ls.iterator(); iter.hasNext();)
                rol = rol + (String)iter.next();

        }
        return rol;
    }

    protected boolean isAuthorized(HttpServletRequest request)
    {
        return obtenerRol(request).indexOf("7") != -1;
    }

    public static String NIVEL_ACCESO_GENERAL = "0";

}
